<%@ page import="com.webamc.common.enums.Params" %>
<%@ page import="com.webamc.config.StaticData" %>
<%@ page import="com.webamc.common.enums.Fields" %>
<%
    final String key = (String) request.getAttribute(Params.KEY);
    final String sel = (String) request.getAttribute(Params.SEL); //CAN BE NULLs
%>
<script type="text/javascript">
    function setFields(obj) {
        var selOption = obj.options[obj.selectedIndex];
        //        var pName = option.value;
        var pWarranty = selOption.title;
        var wObj = document.getElementsByName("<%=Fields.WARRANTY%>");
        if(pWarranty && wObj.length>0){
          wObj[0].value = pWarranty;  
        }
    }
</script>
<select name="<%=key%>" onchange="setFields(this)">
    <% for (String[] s : StaticData.instance().getTwoD(key)) {%>
    <option title="<%=s[1]%>" <%=s[0].equals(sel)?" SELECTED ":""%> value="<%=s[0]%>"><%=s[0]%>
    </option>
    <%}%>
</select>